dojo.provide("icubox.LivePlayer");

//Require some common widget resources
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");

dojo.declare("icubox.LivePlayer",
    [dijit._Widget, dijit._Templated], {        		    	    
        liveCounter: 3,
        templateString: "<div class=\"liveplayer\" >"+
                        "<img dojoAttachPoint='live1' src=\"img/Caveman_32x32.png\" />"+
                        "<img dojoAttachPoint='live2' src=\"img/Caveman_32x32.png\" />"+
                        "<img dojoAttachPoint='live3' src=\"img/Caveman_32x32.png\" />"+
                        "</div>",
        postCreate : function() { 
        },
        getLive : function() {
          return this.liveCounter;
        },
        resetLive   : function() {
         this.liveCounter = 3
          dojo.style(this.live1,"visibility","visible");  
          dojo.style(this.live2,"visibility","visible");  
          dojo.style(this.live3,"visibility","visible");  
        },
        deleteLive : function() {

          if(this.liveCounter == 3 ){
          //dojo.destroy(this.live3);
           dojo.style(this.live3,"visibility","hidden");  
          }else if(this.liveCounter == 2){
          //dojo.destroy(this.live2);
           dojo.style(this.live2,"visibility","hidden");  
          }else if(this.liveCounter == 1){
          //dojo.destroy(this.live1);
           dojo.style(this.live1,"visibility","hidden");            
          } 

          this.liveCounter--;
        }      
   } // end icubox.LivePlayer
);